console.log('======全局注册组件')
const context = require.context('@/components', true, /index$/)
const urls = context.keys()// 获取相对路径

urls.forEach(url => {
  /* 获取到文件名 */
  const name = url.match(/\.\/(\S*)\/index/)[ 1 ]

  Vue.component(name, context(url).default)
})
